#include <stdio.h>
#include <stdlib.h>

#define ROW_COUNT 3
#define COL_COUNT 4
int main(int argc, char *argv[]) {
  /* 指针访问二维数组
   */
  int a[ROW_COUNT][COL_COUNT] = {
      {10, 200, 30, 40}, {50, 60, 70, 80}, {90, 100, 130, 120}};
  int max = a[0][0];
  /* int *p = a[0];
  for (int row = 0; row < ROW_COUNT; row++) {
    for (int col = 0; col < COL_COUNT; col++) {
      if (max < *(p + row * COL_COUNT + col)) {
        max = *(p + row * COL_COUNT + col);
      }
    }
  } */
  for (int *p = a[0]; p < a[0] + ROW_COUNT * COL_COUNT; p++) {
    if (max < *p) {
      max = *p;
    }
  }
  printf("%d\n", max);
  return EXIT_SUCCESS;
}
